#include "gofgame/dungeonkeeper/game/unit/Skull.h"

using namespace gofgame::dungeonkeeper::game::unit;

Skull::Skull(){
	id = 101;
}

Skull::~Skull(){
}

bool Skull::init(){
	bool pRet = false;
	do 
	{
		unitType = UnitType::createById(this->id);
		texture = CCSprite::create(unitType.imageName);
		this->addChild(texture);
		updateState();
		Unit::init();
		pRet = true;
	} while (0);
	return pRet;
}

Skull * Skull::createByLevel(int lv){
	Skull *skull = new Skull();
	if(skull){
		skull->lv = lv;
		if( skull->init()){
			return skull;
		} else {
			return nullptr;
		}
	} else{
		return nullptr;
	}
}

void Skull::initData(){
	unitType.updateLv(lv);
	this->origHp = unitType.getBaseHP();
	this->currentHp = origHp;
	this->atk =  unitType.getBaseAtk();
	this->def =  unitType.getBaseDef();
	this->speed = unitType.getBaseSpeed();
	this->attkSpeed = unitType.getBaseAttackSpeed();
	this->range = unitType.getBaseRange();
}


void Skull::doAI(){

}
